/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-10-16     liuchao       the first version
 */
#include <stdio.h>

#define MCU_ID_BASE 0x1FFF7A10

int get_mcu_id(char *data, int data_size)
{
    unsigned int mcu_id[3];
    mcu_id[0] = *(unsigned int*) (MCU_ID_BASE);
    mcu_id[1] = *(unsigned int*) (MCU_ID_BASE + 4);
    mcu_id[2] = *(unsigned int*) (MCU_ID_BASE + 8);
    return snprintf(data, data_size, "%X%X%X", mcu_id[0], mcu_id[1], mcu_id[2]);
}
